#ifndef _GLOBALMESSAGE_H_
#define _GLOBALMESSAGE_H_
#include <stdbool.h>
#define NameSize 20
#define ContentSize 1024
//在线用户结构体
struct ClientInfo
{
    char ClientName[NameSize];
    int sock;

};

typedef struct ClientInfo CInfo;
CInfo* CreateCInfo(const char *name,int sock);
void PrintCInfo(void *p);
bool IsClientNameEqual(void*ClientPtr,void* clientName);
bool IsClientSockEqual(void*ClientPtr,void*sock);

enum Request
{
    LOGIN = -2, //登录
    SIGNUP = -1, //注册
    CHAT = 1,  //私聊
    BROADCAST, //广播
    ONLINELIST, //在线列表
    SENDFILE, //发送文件
    MYCLOUD , //我的网盘
    FRIEND, //好友
    GROUPCHAT,
    FILELIST = 128, //查看网盘文件列表
    UPLOAD,//上传
    DOWNLOAD, //下载
    BACK,
    
    FRIENDLIST = 200, //好友列表
    ADDFRIEND, //添加好友
    FRIENDREQUEST,
    DELETEFRIEND, //删除好友
    SENDMESSAGES,//发送消息
    BACK1, //返回

    GROUPCHATLIST = 300,
    CREATEGROUPCHAT,
    GROUPCHATREQUEST,
    JOINGROUPCHAT,
    EXITGROUPCHAT,
    INVITETOGROUP,
    BACK2
};

//信息结构体
struct GlobalMessage
{
    char FromName[NameSize];//信息来源
    char ToName[NameSize]; //信息目标
    char Content[ContentSize]; //信息主体
    char Content1[ContentSize];
    char Content2[ContentSize];
    char Content3[ContentSize];
    char Content4[ContentSize];
    int flag ; //功能标志位
    char z[NameSize];
};

typedef struct GlobalMessage MSG;


#endif